Optimal. Leaf size=510 \[ \frac {(g+h x)^{m+1} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-h \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-h \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} F_1\left (m+1;-p,-p;m+2;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right ) \left (f h (m+1) (b g-a h)+c \left (2 f g^2 (p+1)-h (m+2 p+3) (e g-d h)\right )\right )}{c h^3 (m+1) (m+2 p+3)}-\frac {(g+h x)^{m+2} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-h \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-h \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} (b f h (m+p+2)+c (2 f g (p+1)-e h (m+2 p+3))) F_1\left (m+2;-p,-p;m+3;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )}{c h^3 (m+2) (m+2 p+3)}+\frac {f (g+h x)^{m+1} \left (a+b x+c x^2\right )^{p+1}}{c h (m+2 p+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.83, antiderivative size = 508, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {1653, 843, 759, 133} \[ \frac {(g+h x)^{m+1} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-h \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-h \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} F_1\left (m+1;-p,-p;m+2;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right ) \left (f h (m+1) (b g-a h)-c h (m+2 p+3) (e g-d h)+2 c f g^2 (p+1)\right )}{c h^3 (m+1) (m+2 p+3)}-\frac {(g+h x)^{m+2} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-h \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-h \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} (b f h (m+p+2)-c e h (m+2 p+3)+2 c f g (p+1)) F_1\left (m+2;-p,-p;m+3;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )}{c h^3 (m+2) (m+2 p+3)}+\frac {f (g+h x)^{m+1} \left (a+b x+c x^2\right )^{p+1}}{c h (m+2 p+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 133
Rule 759
Rule 843
Rule 1653
Rubi steps
\begin {align*} \int (g+h x)^m \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx &=\frac {f (g+h x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c h (3+m+2 p)}+\frac {\int (g+h x)^m (-h (a f h (1+m)+b f g (1+p)-c d h (3+m+2 p))-h (2 c f g (1+p)+b f h (2+m+p)-c e h (3+m+2 p)) x) \left (a+b x+c x^2\right )^p \, dx}{c h^2 (3+m+2 p)}\\ &=\frac {f (g+h x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c h (3+m+2 p)}-\frac {(2 c f g (1+p)+b f h (2+m+p)-c e h (3+m+2 p)) \int (g+h x)^{1+m} \left (a+b x+c x^2\right )^p \, dx}{c h^2 (3+m+2 p)}+\frac {\left (f h (b g-a h) (1+m)+2 c f g^2 (1+p)-c h (e g-d h) (3+m+2 p)\right ) \int (g+h x)^m \left (a+b x+c x^2\right )^p \, dx}{c h^2 (3+m+2 p)}\\ &=\frac {f (g+h x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c h (3+m+2 p)}-\frac {\left ((2 c f g (1+p)+b f h (2+m+p)-c e h (3+m+2 p)) \left (a+b x+c x^2\right )^p \left (1-\frac {g+h x}{g-\frac {\left (b-\sqrt {b^2-4 a c}\right ) h}{2 c}}\right )^{-p} \left (1-\frac {g+h x}{g-\frac {\left (b+\sqrt {b^2-4 a c}\right ) h}{2 c}}\right )^{-p}\right ) \operatorname {Subst}\left (\int x^{1+m} \left (1-\frac {2 c x}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h}\right )^p \left (1-\frac {2 c x}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )^p \, dx,x,g+h x\right )}{c h^3 (3+m+2 p)}+\frac {\left (\left (f h (b g-a h) (1+m)+2 c f g^2 (1+p)-c h (e g-d h) (3+m+2 p)\right ) \left (a+b x+c x^2\right )^p \left (1-\frac {g+h x}{g-\frac {\left (b-\sqrt {b^2-4 a c}\right ) h}{2 c}}\right )^{-p} \left (1-\frac {g+h x}{g-\frac {\left (b+\sqrt {b^2-4 a c}\right ) h}{2 c}}\right )^{-p}\right ) \operatorname {Subst}\left (\int x^m \left (1-\frac {2 c x}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h}\right )^p \left (1-\frac {2 c x}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )^p \, dx,x,g+h x\right )}{c h^3 (3+m+2 p)}\\ &=\frac {f (g+h x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c h (3+m+2 p)}+\frac {\left (f h (b g-a h) (1+m)+2 c f g^2 (1+p)-c h (e g-d h) (3+m+2 p)\right ) (g+h x)^{1+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )^{-p} F_1\left (1+m;-p,-p;2+m;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )}{c h^3 (1+m) (3+m+2 p)}-\frac {(2 c f g (1+p)+b f h (2+m+p)-c e h (3+m+2 p)) (g+h x)^{2+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h}\right )^{-p} \left (1-\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )^{-p} F_1\left (2+m;-p,-p;3+m;\frac {2 c (g+h x)}{2 c g-\left (b-\sqrt {b^2-4 a c}\right ) h},\frac {2 c (g+h x)}{2 c g-\left (b+\sqrt {b^2-4 a c}\right ) h}\right )}{c h^3 (2+m) (3+m+2 p)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F] time = 2.28, size = 0, normalized size = 0.00 \[ \int (g+h x)^m \left (a+b x+c x^2\right )^p \left (d+e x+f x^2\right ) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.93, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (f x^{2} + e x + d\right )} {\left (c x^{2} + b x + a\right )}^{p} {\left (h x + g\right )}^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (f x^{2} + e x + d\right )} {\left (c x^{2} + b x + a\right )}^{p} {\left (h x + g\right )}^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.16, size = 0, normalized size = 0.00 \[ \int \left (f \,x^{2}+e x +d \right ) \left (h x +g \right )^{m} \left (c \,x^{2}+b x +a \right )^{p}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (f x^{2} + e x + d\right )} {\left (c x^{2} + b x + a\right )}^{p} {\left (h x + g\right )}^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (g+h\,x\right )}^m\,{\left (c\,x^2+b\,x+a\right )}^p\,\left (f\,x^2+e\,x+d\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________